Integrand size = 35, antiderivative size = 211 \[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\frac {4 a b (5 A+3 C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (7 a^2 (3 A+C)+b^2 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {8 a b C \sin (c+d x)}{35 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (4 a^2 C+b^2 (7 A+5 C)\right ) \sin (c+d x)}{21 d \sqrt {\sec (c+d x)}}+\frac {2 C (a+b \cos (c+d x))^2 \sin (c+d x)}{7 d \sqrt {\sec (c+d x)}} \]
[Out]
Time = 0.55 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4306, 3129, 3112, 3102, 2827, 2720, 2719} \[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\frac {2 \left (4 a^2 C+b^2 (7 A+5 C)\right ) \sin (c+d x)}{21 d \sqrt {\sec (c+d x)}}+\frac {2 \left (7 a^2 (3 A+C)+b^2 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {4 a b (5 A+3 C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {8 a b C \sin (c+d x)}{35 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 C \sin (c+d x) (a+b \cos (c+d x))^2}{7 d \sqrt {\sec (c+d x)}} \]
[In]
[Out]
Rule 2719
Rule 2720
Rule 2827
Rule 3102
Rule 3112
Rule 3129
Rule 4306
Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {(a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 C (a+b \cos (c+d x))^2 \sin (c+d x)}{7 d \sqrt {\sec (c+d x)}}+\frac {1}{7} \left (2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {(a+b \cos (c+d x)) \left (\frac {1}{2} a (7 A+C)+\frac {1}{2} b (7 A+5 C) \cos (c+d x)+2 a C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {8 a b C \sin (c+d x)}{35 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 C (a+b \cos (c+d x))^2 \sin (c+d x)}{7 d \sqrt {\sec (c+d x)}}+\frac {1}{35} \left (4 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\frac {5}{4} a^2 (7 A+C)+\frac {7}{2} a b (5 A+3 C) \cos (c+d x)+\frac {5}{4} \left (4 a^2 C+b^2 (7 A+5 C)\right ) \cos ^2(c+d x)}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {8 a b C \sin (c+d x)}{35 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (4 a^2 C+b^2 (7 A+5 C)\right ) \sin (c+d x)}{21 d \sqrt {\sec (c+d x)}}+\frac {2 C (a+b \cos (c+d x))^2 \sin (c+d x)}{7 d \sqrt {\sec (c+d x)}}+\frac {1}{105} \left (8 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\frac {5}{8} \left (7 a^2 (3 A+C)+b^2 (7 A+5 C)\right )+\frac {21}{4} a b (5 A+3 C) \cos (c+d x)}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {8 a b C \sin (c+d x)}{35 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (4 a^2 C+b^2 (7 A+5 C)\right ) \sin (c+d x)}{21 d \sqrt {\sec (c+d x)}}+\frac {2 C (a+b \cos (c+d x))^2 \sin (c+d x)}{7 d \sqrt {\sec (c+d x)}}+\frac {1}{5} \left (2 a b (5 A+3 C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx+\frac {1}{21} \left (\left (7 a^2 (3 A+C)+b^2 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {4 a b (5 A+3 C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (7 a^2 (3 A+C)+b^2 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {8 a b C \sin (c+d x)}{35 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (4 a^2 C+b^2 (7 A+5 C)\right ) \sin (c+d x)}{21 d \sqrt {\sec (c+d x)}}+\frac {2 C (a+b \cos (c+d x))^2 \sin (c+d x)}{7 d \sqrt {\sec (c+d x)}} \\ \end{align*}
Time = 2.86 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.70 \[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\frac {\sqrt {\sec (c+d x)} \left (168 a b (5 A+3 C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+20 \left (7 a^2 (3 A+C)+b^2 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+\left (70 A b^2+70 a^2 C+65 b^2 C+84 a b C \cos (c+d x)+15 b^2 C \cos (2 (c+d x))\right ) \sin (2 (c+d x))\right )}{210 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(531\) vs. \(2(239)=478\).
Time = 8.57 (sec) , antiderivative size = 532, normalized size of antiderivative = 2.52
method | result | size |
default | \(-\frac {2 \sqrt {\left (-1+2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (240 C \,b^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-336 a b C -360 C \,b^{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (140 A \,b^{2}+140 a^{2} C +336 a b C +280 C \,b^{2}\right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-70 A \,b^{2}-70 a^{2} C -84 a b C -80 C \,b^{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+105 A \,a^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+35 A \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-210 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b +35 a^{2} C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+25 C \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-126 C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b \right )}{105 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-1+2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) | \(532\) |
parts | \(\text {Expression too large to display}\) | \(868\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.12 (sec) , antiderivative size = 238, normalized size of antiderivative = 1.13 \[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\frac {42 i \, \sqrt {2} {\left (5 \, A + 3 \, C\right )} a b {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 42 i \, \sqrt {2} {\left (5 \, A + 3 \, C\right )} a b {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) - 5 \, \sqrt {2} {\left (7 i \, {\left (3 \, A + C\right )} a^{2} + i \, {\left (7 \, A + 5 \, C\right )} b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 5 \, \sqrt {2} {\left (-7 i \, {\left (3 \, A + C\right )} a^{2} - i \, {\left (7 \, A + 5 \, C\right )} b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + \frac {2 \, {\left (15 \, C b^{2} \cos \left (d x + c\right )^{3} + 42 \, C a b \cos \left (d x + c\right )^{2} + 5 \, {\left (7 \, C a^{2} + {\left (7 \, A + 5 \, C\right )} b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{105 \, d} \]
[In]
[Out]
\[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int \left (A + C \cos ^{2}{\left (c + d x \right )}\right ) \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sqrt {\sec {\left (c + d x \right )}}\, dx \]
[In]
[Out]
\[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sqrt {\sec \left (d x + c\right )} \,d x } \]
[In]
[Out]
\[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sqrt {\sec \left (d x + c\right )} \,d x } \]
[In]
[Out]
Timed out. \[ \int (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int \left (C\,{\cos \left (c+d\,x\right )}^2+A\right )\,\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}\,{\left (a+b\,\cos \left (c+d\,x\right )\right )}^2 \,d x \]
[In]
[Out]